import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.WindowConstants;

import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class trade4GUI extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JButton jButton = null;
	private JButton jButton1 = null;
	private JButton jButton2 = null;
	private JButton jButton3 = null;
	private JButton jButton4 = null;
	private JButton jButton5 = null;
	private JButton jButton6 = null;
	private JButton jButton7 = null;
	private JButton jButton8 = null;
	private JButton jButton9 = null;
	private JLabel jLabel = null;
	private Players[] player;
	private Deeds[] deeds;
	private int playerchosen;
	private int playerturn;
	private JFrame frame;
	private JButton jButton10 = null;
	private PropertyEvent property;

	/**
	 * This is the default constructor
	 */
	public trade4GUI(PropertyEvent property, int chosen, int turn, Players[] players, Deeds[] deeds,JFrame frame) {
		super();
		this.playerchosen=chosen;
		this.property=property;
		this.playerturn=turn;
		this.player=players;
		this.deeds=deeds;
		this.frame=frame;
		
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(855, 600);
		this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE) ;
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
		this.setVisible(true);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(429, 523, 16, 22));
			jLabel.setText("3");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getJButton(), null);
			jContentPane.add(getJButton1(), null);
			jContentPane.add(getJButton2(), null);
			jContentPane.add(getJButton3(), null);
			jContentPane.add(getJButton4(), null);
			jContentPane.add(getJButton5(), null);
			jContentPane.add(getJButton6(), null);
			jContentPane.add(getJButton7(), null);
			jContentPane.add(getJButton8(), null);
			jContentPane.add(getJButton9(), null);
			jContentPane.add(jLabel, null);
			jContentPane.add(getJButton10(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			if(deeds[16].getOwner()!=player[this.playerturn].getName()){
				jButton.setEnabled(false);
			}
			jButton.setBounds(new Rectangle(38, 24, 168, 208));
			jButton.setIcon(new ImageIcon(getClass().getResource("/Images/Illinois.jpg")));
			jButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,16,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton;
	}

	/**
	 * This method initializes jButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			if(deeds[17].getOwner()!=player[this.playerturn].getName()){
				jButton1.setEnabled(false);
			}
			jButton1.setBounds(new Rectangle(251, 27, 175, 204));
			jButton1.setIcon(new ImageIcon(getClass().getResource("/Images/BO.jpg")));
			jButton1.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,17,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton1;
	}

	/**
	 * This method initializes jButton2	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton2() {
		if (jButton2 == null) {
			jButton2 = new JButton();
			if(deeds[18].getOwner()!=player[this.playerturn].getName()){
				jButton2.setEnabled(false);
			}
			jButton2.setBounds(new Rectangle(459, 31, 171, 209));
			jButton2.setIcon(new ImageIcon(getClass().getResource("/Images/Atlantic.jpg")));
			jButton2.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,18,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton2;
	}

	/**
	 * This method initializes jButton3	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton3() {
		if (jButton3 == null) {
			jButton3 = new JButton();
			if(deeds[19].getOwner()!=player[this.playerturn].getName()){
				jButton3.setEnabled(false);
			}
			jButton3.setBounds(new Rectangle(658, 31, 167, 209));
			jButton3.setIcon(new ImageIcon(getClass().getResource("/Images/Ventor.jpg")));
			jButton3.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed()
				}
			});
			jButton3.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,19,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton3;
	}

	/**
	 * This method initializes jButton4	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton4() {
		if (jButton4 == null) {
			jButton4 = new JButton();
			if(deeds[20].getOwner()!=player[this.playerturn].getName()){
				jButton4.setEnabled(false);
			}
			jButton4.setBounds(new Rectangle(36, 270, 167, 206));
			jButton4.setIcon(new ImageIcon(getClass().getResource("/Images/WW.jpg")));
			jButton4.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,20,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton4;
	}

	/**
	 * This method initializes jButton5	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton5() {
		if (jButton5 == null) {
			jButton5 = new JButton();
			if(deeds[21].getOwner()!=player[this.playerturn].getName()){
				jButton5.setEnabled(false);
			}
			jButton5.setBounds(new Rectangle(254, 270, 166, 204));
			jButton5.setIcon(new ImageIcon(getClass().getResource("/Images/MarvinGardens.JPG")));
			jButton5.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,21,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton5;
	}

	/**
	 * This method initializes jButton6	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton6() {
		if (jButton6 == null) {
			jButton6 = new JButton();
			if(deeds[22].getOwner()!=player[this.playerturn].getName()){
				jButton6.setEnabled(false);
			}
			jButton6.setBounds(new Rectangle(463, 274, 171, 201));
			jButton6.setIcon(new ImageIcon(getClass().getResource("/Images/Pacific.jpg")));
			jButton6.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,22,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton6;
	}

	/**
	 * This method initializes jButton7	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton7() {
		if (jButton7 == null) {
			jButton7 = new JButton();
			if(deeds[23].getOwner()!=player[this.playerturn].getName()){
				jButton7.setEnabled(false);
			}
			jButton7.setBounds(new Rectangle(656, 273, 161, 201));
			jButton7.setIcon(new ImageIcon(getClass().getResource("/Images/Nth.jpg")));
			jButton7.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,23,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton7;
	}

	/**
	 * This method initializes jButton8	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton8() {
		if (jButton8 == null) {
			jButton8 = new JButton();
			jButton8.setBounds(new Rectangle(351, 506, 50, 54));
			jButton8.setText("<");
			jButton8.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade3GUI gui = new trade3GUI(property,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton8;
	}

	/**
	 * This method initializes jButton9	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton9() {
		if (jButton9 == null) {
			jButton9 = new JButton();
			jButton9.setBounds(new Rectangle(465, 505, 51, 54));
			jButton9.setText(">");
			jButton9.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade5GUI gui = new trade5GUI(property,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton9;
	}

	/**
	 * This method initializes jButton10	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton10() {
		if (jButton10 == null) {
			jButton10 = new JButton();
			jButton10.setBounds(new Rectangle(576, 505, 106, 55));
			jButton10.setText("cancel trade");
			jButton10.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					frame.setEnabled(true);
					setVisible(false);
				}
			});
		}
		return jButton10;
	}

}
